#ifndef __USB_MIDI_H
#define __USB_MIDI_H

#ifdef __cplusplus
extern "C" {
#endif

#include "usbd_customhid.h"
#include "usbd_ctlreq.h"
#include "stdint.h"

//midi码事件类型
#define MIDI_STATUS_NOTE_OFF         0x80
#define MIDI_STATUS_NOTE_ON          0x90
#define MIDI_STATUS_AFTERTOUCH       0xA0
#define MIDI_STATUS_CONTROL_CHANGE   0xB0
#define MIDI_STATUS_PROGRAM_CHANGE   0xC0
#define MIDI_STATUS_CHANNEL_PRESSURE 0xD0
#define MIDI_STATUS_PITCH_WHEEL      0xE0
//#define MIDI_STATUS_SYSTEM          0xF0

//系统码具体类型
/*消息类型为系统消息时，低四位的数据定义*/
#define MIDI_SYSEX_Start                      0xF0   //系统独有的格式
#define MIDI_SYSEX_End                        0xF7

#define MIDI_SYS_MTC_Quarter_Frame_Message	  0xF1   //2
#define MIDI_SYS_Song_Position_Pointer		  0xF2   //3
#define MIDI_SYS_Song_Select				  0xF3   //2
#define MIDI_SYS_Tune_Request				  0xF6   //1                
#define MIDI_SYS_Clock						  0xF8   //1
#define MIDI_SYS_Tick						  0xF9   //1
#define MIDI_SYS_Start						  0xFA   //1
#define MIDI_SYS_Stop						  0xFC   //1
#define MIDI_SYS_Continue					  0xFB   //1
#define MIDI_SYS_ActiveSense				  0xFE   //1
#define MIDI_SYS_Reset						  0xFF   //1



extern __ALIGN_BEGIN uint8_t USBD_CUSTOM_HID_CfgFSDesc[USB_CUSTOM_HID_CONFIG_DESC_SIZ] __ALIGN_END;

uint8_t USB_HID_Send(uint8_t *data, uint16_t len);

#ifdef __cplusplus
}
#endif

#endif

